package com.chinadaas.hangzhou.archetypeweb.domain.vo;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author Lux Sun
 * @Description: @JsonInclude(JsonInclude.Include.NON_NULL): 保证序列化JSON的时候，如果是null的对象，key也会消失
 * @Create: 2020/5/6 21:01
 */
@Data
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ResultVO<T> {

    private String code;

    private String msg;

    private T data;

    public ResultVO(String code) {
        this.code = code;
    }

    public ResultVO(String code, T data) {
        this.code = code;
        this.data = data;
    }

    public ResultVO(String code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ResultVO(String code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
}